package com.ruoyi.project.system.personnel.domain;


import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.io.Serializable;
import java.util.Date;

/**
 * 申请表
 *
 * @author LHF
 */
public class Apply implements Serializable {

    private static final long serialVersionUID = -782693040921320583L;

    /**
     * id
     */
    private Integer id;

    /**
     * 标题
     */
    private String title;

    /**
     * 申请人
     */
    private String applicant;

    /**
     * 申请时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 申请内容
     */
    private String content;

    /**
     * 审批状态 0审批中  1通过  2未通过
     */
    private String status;

    /**
     * 附件名字
     */
    private String fileName;

    /**
     * 附件路径
     */
    private String url;

    public Apply() {}

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getApplicant() {
        return applicant;
    }

    public void setApplicant(String applicant) {
        this.applicant = applicant;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getStatus() {
        return status.equals("0")?"审批中":status.equals("1")?"通过":"未通过";
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("title", getTitle())
                .append("applicant", getApplicant())
                .append("createTime", getCreateTime())
                .append("content", getContent())
                .append("status", getStatus())
                .append("fileName", getFileName())
                .append("url", getUrl())
                .toString();
    }
}
